function DrawVector2(angleValues, Mn_R_Values)
    % Unique identifier for the figure
    figTag = 'Vector3DPlotWindow';

    % Try to find the figure
    figHandle = findobj('Type', 'Figure', 'Tag', figTag);

    % Efficient figure handling
    if isempty(figHandle)
        figHandle = figure('Tag', figTag, 'Color', 'w');
    else
        figure(figHandle);  % Bring to front if exists
        clf;  % Clear figure only if it already exists
    end

    % Pre-compute trigonometric values for angles
    cosPhiBlue = cos(deg2rad(angleValues(2)));
    sinPhiBlue = sin(deg2rad(angleValues(2)));
    cosThetaBlue = cos(deg2rad(angleValues(4)));
    sinThetaBlue = sin(deg2rad(angleValues(4)));

    cosPhiRed = cos(deg2rad(angleValues(1)));
    sinPhiRed = sin(deg2rad(angleValues(1)));
    cosThetaRed = cos(deg2rad(angleValues(3)));
    sinThetaRed = sin(deg2rad(angleValues(3)));

    % Convert angles from degrees to radians for direct computation
    % Simplify vector calculations
    blueVector = 7 * [sinThetaBlue * cosPhiBlue, sinThetaBlue * sinPhiBlue, cosThetaBlue];
    result = min(6, sqrt((Mn_R_Values(2)^2) * (csc(deg2rad(angleValues(1)))^2) + Mn_R_Values(1)^2));
    redVector = result * [sinThetaRed * cosPhiRed, sinThetaRed * sinPhiRed, cosThetaRed];

    % Calculate axis length once
    axisLength = max(7, result) + 1;  % since blueVector length is fixed at 7

    % Start plotting
    hold on;

    % Plot vectors
    quiver3(0, 0, 0, blueVector(1), blueVector(2), blueVector(3), 'b', 'LineWidth', 3, 'MaxHeadSize', 0.5);
    quiver3(0, 0, 0, redVector(1), redVector(2), redVector(3), 'r', 'LineWidth', 3, 'MaxHeadSize', 0.5);


    % Create a basis for the plane using the two vectors
    u = blueVector / norm(blueVector); % Normalized blue vector
    v = redVector - dot(redVector, u) * u; % Orthogonal component of red vector
    v = v / norm(v); % Normalized

    % Define the size and resolution of the grid on the plane
    desiredGridDensity = 50; % Control grid density
    gridSize = max([norm(blueVector), norm(redVector)]) / 1.5;
    n = round(sqrt(desiredGridDensity)); % Number of divisions

    % Create the grid
    xGrid = linspace(-gridSize, gridSize, n);
    yGrid = linspace(-gridSize, gridSize, n);
    [xGrid, yGrid] = meshgrid(xGrid, yGrid);

    % Transform grid points to the plane defined by the vectors
    planePoints = xGrid(:) * u + yGrid(:) * v;
    X = reshape(planePoints(:, 1), size(xGrid));
    Y = reshape(planePoints(:, 2), size(yGrid));
    Z = reshape(planePoints(:, 3), size(xGrid));

    % Plot the plane with a transparent grid
    surf(X, Y, Z, 'FaceColor', 'yellow', 'FaceAlpha', 0.3, 'EdgeColor', 'black', 'EdgeAlpha', 0.2);




    % Plot axes with one call per axis direction
    quiver3([0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], ...
            [axisLength, -axisLength, 0, 0, 0, 0], [0, 0, axisLength, -axisLength, 0, 0], ...
            [0, 0, 0, 0, axisLength, -axisLength], 'k', 'LineWidth', 1);



    % Define the angle in radians
    theta = deg2rad(30);
    
    % Determine the length of the line
    lineLength = axisLength;
    
    % Calculate the line points extending from -lineLength to +lineLength
    t = [-lineLength, lineLength]; % Parameter t ranges from -lineLength to +lineLength
    
    % Calculate the coordinates of the line in the XY plane
    xLine = t * cos(theta);
    yLine = t * sin(theta);
    zLine = [0, 0]; % The line is in the XY plane (z = 0)
    
    % Plot the dashed grey line extending in both directions
    plot3(xLine, yLine, zLine, '--', 'Color', [0.5, 0.5, 0.5], 'LineWidth', 1.5);
    
    % Label the positive end of the line
    text(lineLength * cos(theta), lineLength * sin(theta), 0, 'b', 'FontSize', 12, 'Color', [0.5, 0.5, 0.5]);



    % Add names to the vectors
    text(blueVector(1), blueVector(2), blueVector(3), 'Mn', 'FontSize', 15, 'Color', 'blue');
    text(redVector(1), redVector(2), redVector(3), 'R', 'FontSize', 15, 'Color', 'red');

    % Label the ends of the axes
    text(axisLength, 0, 0, 'X(a)', 'FontSize', 12, 'Color', 'k');
    text(0, axisLength, 0, 'Y', 'FontSize', 12, 'Color', 'k');
    text(0, 0, axisLength, 'Z', 'FontSize', 12, 'Color', 'k');

    % Turn off the default box, grid, and axis ticks
    axis off;
    %set(gca, 'Visible', 'on', 'Color', 'none');
    set(gca, 'XColor', 'k', 'YColor', 'k', 'ZColor', 'k');
    set(gca, 'XTick', [], 'YTick', [], 'ZTick', []);


    % Set the plot limits and labels
    axis equal;
    xlim([-axisLength, axisLength]);
    ylim([-axisLength, axisLength]);
    zlim([-axisLength, axisLength]);

    % Label axes
    title("Er-along a");

    % Adjust view
    view(40, 15);

    % Finish plotting
    hold off;
end
